#ifndef H_MYSQLAPI_20071013
#define H_MYSQLAPI_20071013

#define FORMAT_DB_AUTH_USER		"SELECT * FROM TUsers WHERE user=\"%s\" AND pass=PASSWORD(\"%s\")"
#define FORMAT_DB_UPDATE_CASH	"UPDATE TUsers SET cash=%lu WHERE user=\'%s\'"
/*
database: DBPoker
Tables:
TUsers
	ID:id
	Username:user
	Password:pass
	status: admin,user
	Cash:cash
	Country:country
	Age:age
	Email:email
	Date of subs:date
	Last connection:date
	one: not used

TBannedUsers
	Username:user
	Host:host
	Email:email
*/

int db_create (void);
int db_export (void);
int db_import (const char* path);

int db_update_cash (Client* me, unsigned long newcash);
int db_auth (Client* me, char user[USERSIZE], char pass[PASSSIZE]);
int db_connect(const char* host, const char* user, const char* pwd, const char* db, unsigned int port, unsigned int flags);
void db_cleanup (void);
void db_err(void);
int	db_query (const char* format, ...);






#endif

